package id.apps.surabayacityguide;

import roboguice.inject.InjectView;

import com.actionbarsherlock.view.Menu;
import com.github.rtyley.android.sherlock.roboguice.activity.RoboSherlockActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class ReferensiLokasiActivity extends RoboSherlockActivity implements OnItemClickListener
{
	// Deklarasi widget
	private @InjectView(R.id.lv_referensiLokasi)
	ListView			lvReferensi;

	// global variable
	private String[]	list_item	=
									{
			"Tempat Wisata", "Kuliner", "Bank", "Pom Bensin", "Masjid"
									};

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_referensi_lokasi);
		lvReferensi.setOnItemClickListener(this);
		setItemToListview();

	}

	/*
	 * set adapter untuk listview
	 */
	private void setItemToListview()
	{
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list_item);
		lvReferensi.setAdapter(adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{
		// TODO Auto-generated method stub
		return super.onCreateOptionsMenu(menu);
	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id)
	{
		switch (position)
		{
			case 0:
				startActivity(new Intent(this, LvWisataActivity.class));
				break;

			// kuliner
			case 1:
				startActivity(new Intent(this, LvKulinerActivity.class));
				break;

		}
	}

}
